package org.opens.javaskill.java;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.junit.Test;

public class EnumDemo {

    public static enum Sex {

        NAN(0),
        NV(1);

        private Integer value;

        Sex(Integer value) {
            this.value = value;
        }
    }

    @Test
    public void test1() {
        System.out.println(Sex.NAN);
    }

    @Test
    public void test2() {
        System.out.println(0 == Sex.NAN.value);
    }

    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public static enum PassStatus {

        INIT(0, "init"),
        PASS(1, "pass"),
        NO_PASS(2, "no_pass");

        private int value;

        private String message;

        PassStatus(int value, String message) {
            this.value = value;
            this.message = message;
        }

        public int getValue() {
            return value;
        }

        public String getMessage() {
            return message;
        }

    }

    @Test
    public void test3() {
        System.out.println(PassStatus.NO_PASS.value);
    }

    @Test
    public void test4() {
        System.out.println(PassStatus.NO_PASS == PassStatus.NO_PASS);
    }

}
